<%-- 
    Document   : createProduct
    Created on : Jan 2, 2013, 3:06:13 PM
    Author     : Nguyen Hung
--%>

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
<%@taglib prefix="rich" uri="http://richfaces.org/rich" %>
<%@taglib prefix="a4j" uri="http://richfaces.org/a4j" %>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" type="text/css" href="../css/product.css"/>
        <!--        <link rel="stylesheet" type="text/css" href="../css/style.css"/>-->
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jq.date.js"></script>   
        <!--        <script type="text/javascript" language="javascript" src="../scripts/jQuery/jquery-1.7.2.min.js"></script>      -->
        <link rel="stylesheet" type="text/css" href="../css/ui.datepicker.css"/>
        <link rel="stylesheet" type="text/css" href="../css/thickbox.css"/>
        <script type="text/javascript" language="javascript" src="../scripts/jQuery/thickbox.js"></script>
        <style>
            .openS100{
                cursor: pointer;
            }
        </style>
        <script type="text/javascript" language="javascript">
            var open_cur = 0;
            $j = jQuery.noConflict();
            
            $j(document).ready(function(){
                $j('.text_search').live('keyup',function(){
                    if($j('.text_search').val() == ""){
                        $j('.row-product').show();
                                   
                    }else{
                        $j('.row-product').hide();
                        $j('.row-product').each(function(){
                            html = $j(this).html();
                            if(   ununicode(html).indexOf(  ununicode($j('.text_search').val()) ) > -1    )  {
                                $j(this).show();
                            }else{
                                $j(this).hide();
                            }
                        });
                    }

                }); 
            });
        </script>
        <style>
            .imgFancybox img{
                height: 26px;
                width: 30px;
            }
        </style>
    </head>

    <body>

        <a4j:form>
            <f:loadBundle basename="#{environmentSession.localizationSource}" var="locale"/>
            <h:outputText value="<div class='permission' lang='#{loginSession.right.TOU_LST_TOUR}'></div>" escape="false"/> 
            <div id="content">
                <div id="menutop_top">
                    <div class="div_search_menutop">
                        <div class="item_search">

                            <h:inputText onfocus="if(this.value=='search') this.value='';" style="float:left;" styleClass="text_search" value="#{EmpBean.keySearch}"/>
                            <div style="float:left;border-top: 1px solid #55ACDB;border-bottom: 1px solid #55ACDB;" class="img_search"> <h:graphicImage style="float:left;" value="../images1/arrow_down.png"/></div>
                            <div style="float:left;border: 1px solid #55ACDB;"> <h:graphicImage styleClass="find_all_emp" style="float:left;" value="../images1/btn_search.png"/></div>
                        </div>
                    <%--    <div class="form_search_header">
                            <div class="item_search "><h:outputText value="x" styleClass="close_search" style="font-weight:bold;float:right;margin-right:2.2%;"/></div>
                            <div class="item_search">
                                <table id="table_search">
                                    <tr>
                                        <td class="celltable">
                                            <h:selectOneRadio styleClass="css_radio" value="#{EmpBean.typeSearch}">
                                                <f:selectItem itemValue="2" itemLabel="Họ tên" />

                                                <f:selectItem itemValue="1" itemLabel="Phone" />
                                                <f:selectItem itemValue="3" itemLabel="CMND" />
                                                <f:selectItem itemValue="5" itemLabel="MSNV" />
                                                <f:selectItem itemValue="4" itemLabel="Email" />

                                            </h:selectOneRadio>
                                        </td>

                                    </tr>
                                    <tr>
                                        <td class="celltable">
                                            <h:commandButton action="#{EmpBean.reload}" value="#{locale.search}" styleClass="buttonsearch">
                                            </h:commandButton>
                                        </td>

                                    </tr>
                                </table>

                            </div>
                        </div> --%>
                    </div>

                    <div class="icon_action">
                        <h:outputLink  rendered="#{loginSession.right.TOU_TOUR_CRE}" value="addS400forTour.jsp?action=add&page=listTour.jsp&SV216=0&height=250px&width=700px"  styleClass="fancybox">

                            <h:graphicImage title="Tạo sản phẩm Tour" style="float:left;" value="../images1/add.png"/>
                        </h:outputLink>

                    </div>

                

                </div>
                <div id="menutop">
                    <div class="dropdown">
                        <div class="select_choise">
                            <a href="#"><span>Khu vực</span></a>
                        </div>
                        <div class="select_hidden">
                            <ul>

                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                                <li><a href="#"><span>Filter Cấp 3</span></a></li>
                            </ul>
                        </div>
                    </div>
                    <h:panelGroup rendered="#{loginSession.right.DAB_LST_PAR}">
                        <div class="dropdown">
                            <div class="select_choise">
                                <a href="#">
                                    <span class="department2" lang="<h:outputText value="#{n450_n850.fn850}"/>">
                                        <h:outputText rendered="#{n450_n850.fn850 !=0}" value="#{n450_n850.nv851}"/>
                                        <h:outputText rendered="#{n450_n850.fn850 ==0}" value="Tất cả"/>
                                    </span>
                                </a>

                            </div>
                            <div class="select_hidden departmentlistN850">

                                <ul>
                                    <li><a href="#"><span class="department3" lang="<h:outputText value="0"/>">
                                                <h:outputText value="Tất cả"/>
                                            </span></a></li>                          


                                    <a4j:repeat value="#{n450_n850.listComb850}" var="item">
                                        <li><a href="#"><span class="department2" lang="<h:outputText value="#{item.value}"/>">
                                                    <h:outputText value="#{item.label}"/>
                                                </span></a></li> 
                                            </a4j:repeat>
                                </ul>
                            </div>
                        </div>
                    </h:panelGroup>

                </div>

                <%--    <div class="fillter">
                        <div class="dropdown">
                            <h:panelGroup id="reload5">
                                <h:panelGroup  rendered="#{EmpBean.fk400 > 0}" >
                                    <div class="select_choise ">

                                        <a href="#"><span><h:outputText value="Action"/></span></a>


                                    </div>
                                    <div class="select_hidden">
                                        <ul>

                                            <li>
                                                <h:outputLink rendered="#{EmpBean.fk400 > 0}" value="addgroupcustomer.jsp?action=loadGroup&page=employeenew.jsp&pk400=#{EmpBean.fk400}&kv451=N100E&KeepThis=true&amp;TB_iframe=true&amp;height=453&amp;width=941&amp;modal=true" styleClass="thickbox add_new" id="thickbox2"  >
                                                    <span> <h:outputText value="#{locale.add_group}"/></span>
                                                </h:outputLink>
                                            </li>
                                            <li >
                                                <h:outputLink rendered="#{EmpBean.fk400 > 0}" value="removegroupcustomer.jsp?action=loadGroup&page=employeenew.jsp&pk400=#{EmpBean.fk400}&kv451=N100E&KeepThis=true&amp;TB_iframe=true&amp;height=425&amp;width=952&amp;modal=true" styleClass="thickbox add_new" id="thickbox3"  >
                                                    <span> <h:outputText value="#{locale.delete_group}"/></span>
                                                </h:outputLink>

                                            </li>


                                        </ul>
                                    </div>
                                </h:panelGroup>
                            </h:panelGroup>
                        </div>
                    </div> --%>

                <div style="width: 100%;float: left;height: 67%;overflow: auto;">
                    <div class="headerdivtable">
                        <div class="itemheaderdivtable_center" style="width: 2%;">
                            <h:outputText value="STT"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 8%;">
                            <h:outputText value="CHI TIẾT"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 26%;">
                            <h:outputText value="TÊN SẢN PHẨM"/>
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 10%;">
                            <h:outputText value="ĐIỂM KHỞI HÀNH" />
                        </div>
                        <%--  <div class="itemheaderdivtable_center" style="width: 6%;">
                              <h:outputText value="XÉT DUYỆT"/>
                          </div> --%>
                        <div class="itemheaderdivtable_center" style="width: 10%;">
                            <h:outputText value="ĐIỂM ĐẾN"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="GIÁ TOUR"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 4%;">
                            <h:outputText value="SỐ NGÀY"/>
                        </div>
                        <div class="itemheaderdivtable_center" style="width: 4%;">
                            <h:outputText value="SỐ NGƯỜI"/>
                        </div>

                        <div class="itemheaderdivtable_center" style="width: 6%;">
                            <h:outputText value="ACTION" />
                        </div>
                        <div class="itemheaderdivtable_center" style="width:20.3%;">
                            <h:outputText value="NGƯỜI TẠO"/>
                        </div>




                    </div>

                    <div class="headerdivtable_over">

                        <a4j:repeat  value="#{SPBean.listS400}" var="item" rowKeyVar="row" rows="30">
                            <div lang="<h:outputText value="#{item.ps400}"/>" class="noteRow headerdivtable_bootom <h:outputText rendered="#{row%2 !=0}"  value="headerdivtable_tr"/>">
                                <div class="itemheaderdivtable_center" style="width: 2%;">
                                    <h:outputText value="#{row +1}" >
                                        <f:convertNumber  pattern="##000"></f:convertNumber>
                                    </h:outputText>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 8%;">
                                    <h:panelGroup rendered="#{loginSession.right.TOU_TOUR_TCK}" ><img style="margin-top: 4px; margin-right:  3px;" src="../images/bg_button2.png" alt="Sản phẩm" title="Sản phẩm" class="openS100 s100 s100<h:outputText value="#{item.ps400}"/>" id="<h:outputText value="#{item.ps400}"/>" /></h:panelGroup>
                                    <h:panelGroup rendered="#{loginSession.right.TOU_TOUR_CAL}"><a style="margin-top: 4px;" href="codeproductTour.jsp?action=detailTour&FS400=<h:outputText value="#{item.ps400}"/>"><h:graphicImage value="../images1/detail.png"/></a> </h:panelGroup> 
                                    </div>
                                    <div class="itemheaderdivtable_left" style="width: 26%;">
                                    <h:outputText value="#{item.sv401} "/> 

                                </div>

                                <div class="itemheaderdivtable_left" style="width: 10%;">
                                    <h:outputText  value="#{item.AV001F} "/>

                                </div>
                                <%--  <div class="itemheaderdivtable_center" style="width: 6%;">
                                      <h:outputText value="XÉT DUYỆT"/>
                                  </div> --%>
                                <div class="itemheaderdivtable_left" style="width: 10%;">
                                    <h:outputText  value="#{item.AV001T} "/>
                                </div>
                                <div class="itemheaderdivtable_right" style="width: 6%;">
                                    <h:outputText value=" #{item.price}" style="font-style:italic;"  >     <f:convertNumber type="currency" currencyCode="EUR"/> </h:outputText>
                                    </div>
                                    <div class="itemheaderdivtable_center" style="width: 4%;">
                                    <h:outputText value=" #{item.sn406}"/>
                                </div>
                                <div class="itemheaderdivtable_center" style="width: 4%;">
                                    <h:outputText   value=" #{item.sn408}" />
                                </div>

                                <div class="itemheaderdivtable_center" style="width: 6%;">
                                    <h:outputLink rendered="#{loginSession.right.TOU_TOUR_MOD}"  value="addS400forTour.jsp?action=editS400&ps400=#{item.ps400}&height=250px&width=700px" styleClass="fancybox add_new" id="fancybox22">
                                        <img src="../images/edit.png" alt="edit" title="edit"/>
                                    </h:outputLink>                                          

                                    <h:outputLink  rendered="#{loginSession.right.TOU_TOUR_DEL}"   value="delete.jsp?id=#{item.ps400}&flag=S400&width=300&height=150" styleClass="fancybox">
                                        <img src="../images/delete_1.png" alt="delete"  title="delete" />
                                    </h:outputLink>
                                </div>
                                <div class="itemheaderdivtable_left" style="width: 20.3%;font-size: 8px;">
                                    <h:outputText value="#{item.sl419}"/>(<h:outputText value="#{item.sl418}"/>)
                                </div>


                            </div>
                            <div class="addS100">

                            </div>
                        </a4j:repeat>
                    </div>
                </div>

                <rich:modalPanel id="ajaxLoadingModalBox" minHeight="30" minWidth="40"
                                 height="30" width="40" zindex="2000">
                    <h:outputText value="#{locale.please_wait}" styleClass="startDummer"></h:outputText>
                </rich:modalPanel>


                <div class="fotter-page">
                    <jsp:include page="../../common/pagingEmployee.jsp"/>
                </div>
            </div>

        </a4j:form>
    </body>
</html>
<script type="text/javascript" language="javascript">
    var open_cur = 0;
    $j = jQuery.noConflict();
            
    $j(document).ready(function(){
        initThickBox('.thickbox');
                
        $j('input#dateRepeat').datepicker({ dateFormat: 'dd/mm/yy', showOn: 'button', buttonImage: '../images/calenda_icon.gif', buttonImageOnly: true });
        $j(".historyContent").css("display","none");     
        $j('.openS100').live('click',function(){
            showPleaseWait();
            var ps400 = $j(this).parent().parent().attr('lang');                      
            $j('.addS100').slideUp();
            $j('.addS100').html(''); 
            var s100 = $j(this).parent().parent().next();                    
            if(s100.hasClass('active')){
                s100.removeClass('active');
            }else{
                                                 
                s100.removeClass('active');
                s100.addClass('active');                                               
                // showPleaseWait();      
              
                $j.post('detailS100.jsp?action=detailS100&ps400='+ps400,function(data){  
                   
                    if(data !=null){
                        //                                alert(sms.attr('class'));
                        hidePleaseWait();
                        s100.css('min-height','150px');
                        s100.html(data);
                        s100.slideDown();
                        //  hidePleaseWait();
                    }
                });
                //                    }
                     
            }
        });
        
        slide = gup( 'tab' );
        if(slide != null && slide !=undefined && slide.length > 0){
            //alert(slide);
            //$j('.'+tab).parent().parent().parent().parent().parent('.tabs_menu').css('display','block');
            $j('.'+slide).trigger('click') ;

        }
                
    });
    function adds100_addform(){
        var sn104 = $j('.selectSN104').val();
        var sn107 = $j('.selectSN107').val();
        alert("aaaa" +sn104);
    }
</script>